package com.oceanread.cn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.oceanread.cn.entity.Projections;
import com.oceanread.cn.mapper.ProjectionsMapper;
import com.oceanread.cn.service.IProjectionsService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IProjectionsServiceImpl extends ServiceImpl<ProjectionsMapper, Projections> implements IProjectionsService {
    @Override
    public List<Projections> getall() {
        return baseMapper.getall();
    }

    @Override
    public Integer getnum() {
        return baseMapper.getnum();
    }

    public Integer getnumquery(String key, String value) {
        return baseMapper.getnumquery(key, value);
    }

    @Override
    public List<Projections> findall(int page, int size) {
        return baseMapper.findall((page - 1) * size, size);
    }

    @Override
    public List<Projections> query(int page, int size, String key, String value) {
        return baseMapper.query((page - 1) * size, size, key, value);
    }

    @Override
    public int insert(
            String SYSID, String Name, String ShortName, String Date,
            String Lon, String Lat, String Type, String CameraHight, String NumPipeline,
            String LengthPipeline, String DepthPipeline, String NumDrillhole,
            String NumProfile, String UndertakingUnit
    ) {
        return baseMapper.insert(
                SYSID, Name, ShortName, Date, Lon, Lat, Type,
                CameraHight, NumPipeline,
                LengthPipeline, DepthPipeline, NumDrillhole,
                NumProfile, UndertakingUnit
        );
    }

    @Override
    public Integer update(Projections projections) {
        return baseMapper.update(
                projections.getId(),
                projections.getPrjCode(),
                projections.getName(),
                projections.getShortName(),
                projections.getDate(),
                projections.getLon(),
                projections.getLat(),
                projections.getType(),
                projections.getCameraHight(),
                projections.getNumPipeline(),
                projections.getLengthPipeline(),
                projections.getDepthPipeline(),
                projections.getNumDrillhole(),
                projections.getNumProfile(),
                projections.getUndertakingUnit());
    }

    public Integer delete(int SYSID) {
        return baseMapper.delete(SYSID);
    }

}
